package org.liveboardgames.agricola.control.delegates.mock.cards.actioncards
{
	import org.liveboardgames.agricola.control.delegates.mock.ActionFactory;
	import org.liveboardgames.agricola.model.enums.HouseTypeEnum;
	import org.liveboardgames.agricola.model.enums.PrerequisiteActionTypeEnum;
	import org.liveboardgames.agricola.view.component.ImageHandler;
	import org.liveboardgames.agricola.vo.action.Action;
	import org.liveboardgames.agricola.vo.card.ActionCard;
	
	import mx.collections.ArrayCollection;
	import mx.collections.ListCollectionView;

	public class PeriodSixCards
	{
		public static const RENOVATION_THEN_FENCES:ActionCard = getRenovThenFencesCard();

		private static function getRenovThenFencesCard():ActionCard
		{
			var card:ActionCard = new ActionCard();
			card.cardName = "Renovation then Fences";
			card.imagePath = ImageHandler.ACTIONS + "RenovationThenFences.png";

			// Build the actions
			var actions:ListCollectionView = new ArrayCollection();

			// Renovation
			var renovToClayAction:Action = ActionFactory.getRenovationAction(HouseTypeEnum.CLAY);
			var renovToStoneAction:Action = ActionFactory.getRenovationAction(HouseTypeEnum.STONE);

			// Improvement
			var fencesActions:Action = ActionFactory.getFencesAction();
			fencesActions.addPrerequisiteAction(renovToClayAction);
			fencesActions.addPrerequisiteAction(renovToStoneAction);
			// If any of the two previous action has been done, this is ok
			fencesActions.prerequisiteActionType = PrerequisiteActionTypeEnum.ANY;

			actions.addItem(renovToClayAction);
			actions.addItem(renovToStoneAction);
			actions.addItem(fencesActions);

			card.actions = actions;

			var exclusiveActions:ListCollectionView = new ArrayCollection();
			exclusiveActions.addItem(renovToClayAction);
			exclusiveActions.addItem(renovToStoneAction);
			card.exclusiveActions = exclusiveActions;

			return card;
		}

	}
}